﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace DataBaseReverseGenerator.DataBaseModel
{
    [Serializable]
    public class RelationShip
    {
        #region Ctor

        public RelationShip()
        {
            this.rules = new List<Rule>();
        }

        public RelationShip(string name) : this()
        {
            this.name = name;
        }

        #endregion

        #region Properties

        private string name;
        [XmlAttribute()]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private string parentTable;
        [XmlAttribute()]
        public string ParentTable
        {
            get { return parentTable; }
            set { parentTable = value; }
        }

        private string childTable;
        [XmlAttribute()]
        public string ChildTable
        {
            get { return childTable; }
            set { childTable = value; }
        }

        private List<Rule> rules;
        public List<Rule> Rules
        {
            get { return rules; }
            set { rules = value; }
        } 

        #endregion
    }

}
